package us.wili.dev.netty.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.RedisTemplate;
import us.wili.dev.dao.mapper.cache.GroupChatCache;
import us.wili.dev.dao.mapper.common.GroupChatMapper;
import us.wili.dev.netty.dao.cache.GameRoomCache;

import javax.annotation.Resource;
import java.math.BigDecimal;

@Configuration
public class CacheConfig {

    @Bean
    public GroupChatCache groupChatCache(GroupChatMapper groupChatMapper,
                                         @Qualifier("jdkRedisTemplate") RedisTemplate redisTemplate){
        return new GroupChatCache(redisTemplate, groupChatMapper );
    }

    @Bean
    public GameRoomCache gameRoomCache(@Qualifier("jdkRedisTemplate")RedisTemplate redisTemplate)
    {
        return new GameRoomCache(redisTemplate);
    }
}
